/**
 * @Description: pfprod扩展js
 * @Date: 2018/7/2 13:14
 */

/**
 * @Description: 实现占位符替换
 * @Return:
 * @Param:
 * @Author: caiyl@hsyuntai.com
 * @Date: 2018/7/2 13:14
 */
String.prototype.format = function() {
    if (arguments.length == 0) return this;
    for (var s = this, i = 0; i < arguments.length; i++){
        s = s.replace(new RegExp("\\{" + i + "\\}", "g"), arguments[i]);
    }
    return s;
};
